<template>
	<view class="cu-modal " :class="showMyPoster?'show':''" @tap='hide'>
		<view class="cu-dialog my-prize-dialog poster">			
			<view class="rule-container" >
				<view class="title" >
					我的奖品
				</view>
				<view class="itembox">
					<view class="item" v-for="(item,i) in myPrizelist" :key="i">
						<text 
							class="left">
							{{item.send_money}} {{item.send_type === 2 ? '优惠券' : '现金红包'}}
						</text>
						<view>
							<view 
								v-if="item.send_type === 2" 
								@clikc="receiveHandle(item)">
								{{item.status === 1?'领取':'已领取'}}
							</view>
							<view 
								v-else 
								@clikc="withdrawalHandle(item)">
								{{item.status === 1?'提现':'已提现'}}
							</view>
						</view>
					</view>
				</view>
				<view class="no-prize" v-if="myPrizelist.length==0 && showNoPrize">
					您还没有获得奖品
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data(){
			return {
				showMyPoster: false,
				myPrizelist: [
					{
						send_money: '0.01',
						send_type: 1,
						status: 1
					},
					{
						send_money: 20,
						send_type: 2,
						status: 2
					}
				],
			}
		},
		methods: {
			// 领取
			receiveHandle(item){
				if(item.status === 2){
					return
				}
			},
			// 提现
			withdrawalHandle(item){
				if(item.status === 2){
					return
				}
			},
			hide(){
				this.showMyPoster = false
			},
			open(){
				this.showMyPoster = true
			}
		}
	}
</script>

<style lang="scss">
	.poster{
		// height: 60vh;
		background-color: transparent;
	}
	.content{
		box-sizing: border-box;
		position: relative;
		width: 100%;
		height: 100%;
		display: flex;
		justify-content: center;
		align-items: center;
		padding: 40rpx;
		.bg{
			position: absolute;
		}
		.box{
			width: 100%;
			color: #fff;
			z-index: 1;
			.item{
				margin-top: 20rpx;
				display: flex;
				justify-content: space-between;
			}
		}
	}
	.my-prize-dialog .itembox {
		max-height: 1320upx;
		overflow-y: auto;
	}
	
	.my-prize-dialog .item {
		width: 100%;
		height: 66upx;
		padding: 0 32upx;
		box-sizing: border-box;
		display: flex;
		align-items: center;
		justify-content: space-between;
	}
	.rule-container {
		min-height: 300upx;
		display: flex;
		flex-direction: column;
		z-index: 3;
		background-image: linear-gradient(-180deg, #F48549 0%, #F2642E 100%);
		border: 18upx solid #E4431A;
		border-radius: 16px;
		padding:30upx;
		/* box-sizing: border-box; */
		color: #fff;
	}
	
	.rule-container .title {
		text-align: center;
		margin-bottom: 36upx;
		font-size: 40upx;
	}
	
	.rule-container .g_item {
		font-size: 30upx;
		color: #FFFFFF;
		letter-spacing: 0.5px;
		text-align: justify;
		line-height: 20px;
		margin-bottom: 10px;
	}
</style>